Essential features

This notebook shows features of streprogen, the Python strength program generator.

Contributions to the code are welcome. :)

[1]:
!pip install streprogen matplotlib --quiet

Imports

[2]:
import matplotlib.pyplot as plt
from streprogen import Program

Program setup

[3]:
program = Program(
    name="EssentialFeatures",
    duration=8, # Weeks
    reps_per_exercise=25,
    units="kg", # Typically 'kg', 'lbs' or '' (empty)
    round_to=5,
)

with program.Day():
    program.DynamicExercise(name="Bench", start_weight=80)

    # The repetition range can be specified as follows
    program.DynamicExercise(name="Squats", start_weight=100,
                            min_reps=3, max_reps=8)

    # A static exercise, which repeats every week
    program.StaticExercise("Curls", "3 x 12")

with program.Day():
    # Specify the increase manually (defaut is 1.5 % per week)
    # Starting at 100kg, 2 % per weeks means 16 % in 8 weeks
    program.DynamicExercise(name="Deadlifts", start_weight=100,
                            percent_inc_per_week=2)

    # If you prefer, the `final_weight` parameter can be used
    program.DynamicExercise(name="Squats",
                            start_weight=90, final_weight=110)

# Default names are 'Day 1', 'Day 2', ..., but can be specified manually
with program.Day("Saturday"):

    # An individual exercise can deviate from the global program repetition setting
    program.DynamicExercise(name="Deadlifts", start_weight=100, reps=15)

    # Or from the default rounding
    program.DynamicExercise(name="Curls", start_weight=30, round_to=2)

Render the program

[4]:
# Do the computations and render a program. Might take a few seconds.
program.render()

Export the program as .html or .tex, then to .pdf

A .html file can be printed directly from your browser, or printed to a .pdf from your browser.

[6]:
# Save the program as a HTML file
with open("EssentialFeatures.html", "w", encoding="utf-8") as file:
    # Control table width (number of sets) by passing the 'table_width' argument
    file.write(program.to_html(table_width=6))

Use a .tex to generate .pdf if you have LaTeX installed, or use:

[7]:
# If you have LaTeX installed on your system, you can render a program to .tex
# Alternatively, you can paste the LaTeX into: https://latexbase.com/
print(program.to_tex(table_width=6))
% -----------------------------------------------
% Package imports
% -----------------------------------------------
\documentclass[12pt, a4paper]{article}% 'twoside' for printing
\usepackage[utf8]{inputenc}% Allow input to be UTF-8
\usepackage[margin=2cm]{geometry}% May be used to set margins

% -----------------------------------------------
% Document start
% -----------------------------------------------

\begin{document}
\large

\section*{Program: EssentialFeatures}

This program was made using \verb|streprogen|,
the Python strength program generator.
The latest version can be found at \\
\verb|https://pypi.python.org/pypi/streprogen/|.


\section*{Program parameters}
\begin{tabular}{l|l}
        \textbf{Parameter} & \textbf{Value} \\ \hline
        \verb|duration|             & 8 \\
        \verb|reps_per_exercise|    & 25 \\
        \verb|intensity|            & 83 \\
        \verb|units|                & kg
\end{tabular}


\section*{Exercise information}
\begin{tabular}{llllll}
    \textbf{Exercise} & \textbf{Start} & \textbf{End} & \textbf{Reps min}
    & \textbf{Reps max} & \textbf{Weekly increase} \\ \hline
      \textbf{ Day 1 } & & & & & \\ \hline
        \hspace{0.5em}Bench &
        80 kg &
        89.6 kg &
        3 & 8 &
        1.5\%\\
        \hspace{0.5em}Squats &
        100 kg &
        112 kg &
        3 & 8 &
        1.5\%\\
       \hspace{0.5em}Curls & \multicolumn{ 5 }{l}{ 3 x 12 } \\
      \textbf{ Day 2 } & & & & & \\ \hline
        \hspace{0.5em}Deadlifts &
        100 kg &
        116 kg &
        3 & 8 &
        2.0\%\\
        \hspace{0.5em}Squats &
        90 kg &
        110 kg &
        3 & 8 &
        2.8\%\\
      \textbf{ Saturday } & & & & & \\ \hline
        \hspace{0.5em}Deadlifts &
        100 kg &
        112 kg &
        3 & 8 &
        1.5\%\\
        \hspace{0.5em}Curls &
        30 kg &
        33.6 kg &
        3 & 8 &
        1.5\%\\
\end{tabular}


\clearpage
\section*{Program}
 \subsection*{\hspace{0.25em} Week 1 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 8 x 60kg
            & 7 x 65kg
            & 7 x 65kg
            & 7 x 65kg
            &
            \\


            \hspace{0.75em} Squats
            & 8 x 75kg
            & 7 x 80kg
            & 7 x 80kg
            & 7 x 80kg
            &
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 8 x 75kg
            & 7 x 80kg
            & 7 x 80kg
            & 7 x 80kg
            &
            \\


            \hspace{0.75em} Squats
            & 8 x 70kg
            & 7 x 70kg
            & 7 x 70kg
            & 7 x 70kg
            &
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 7 x 80kg
            & 6 x 80kg
            & 6 x 80kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 8 x 22kg
            & 7 x 24kg
            & 7 x 24kg
            & 7 x 24kg
            &
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 2 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 7 x 65kg
            & 7 x 65kg
            & 6 x 65kg
            & 5 x 70kg
            & 5 x 70kg
            \\


            \hspace{0.75em} Squats
            & 7 x 80kg
            & 7 x 80kg
            & 6 x 85kg
            & 5 x 85kg
            & 5 x 85kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 7 x 80kg
            & 7 x 80kg
            & 6 x 85kg
            & 5 x 85kg
            & 5 x 85kg
            \\


            \hspace{0.75em} Squats
            & 7 x 75kg
            & 7 x 75kg
            & 6 x 75kg
            & 5 x 80kg
            & 5 x 80kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 7 x 80kg
            & 6 x 85kg
            & 5 x 85kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 7 x 24kg
            & 7 x 24kg
            & 6 x 24kg
            & 5 x 26kg
            & 5 x 26kg
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 3 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 7 x 65kg
            & 6 x 70kg
            & 5 x 70kg
            & 5 x 70kg
            & 5 x 70kg
            \\


            \hspace{0.75em} Squats
            & 7 x 80kg
            & 6 x 85kg
            & 5 x 90kg
            & 5 x 90kg
            & 5 x 90kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 7 x 85kg
            & 6 x 85kg
            & 5 x 90kg
            & 5 x 90kg
            & 5 x 90kg
            \\


            \hspace{0.75em} Squats
            & 7 x 75kg
            & 6 x 80kg
            & 5 x 80kg
            & 5 x 80kg
            & 5 x 80kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 6 x 85kg
            & 6 x 85kg
            & 5 x 90kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 7 x 24kg
            & 6 x 26kg
            & 5 x 26kg
            & 5 x 26kg
            & 5 x 26kg
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 4 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 6 x 70kg
            & 6 x 70kg
            & 5 x 70kg
            & 5 x 70kg
            & 4 x 75kg
            \\


            \hspace{0.75em} Squats
            & 6 x 85kg
            & 6 x 85kg
            & 5 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 6 x 90kg
            & 6 x 90kg
            & 5 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            \\


            \hspace{0.75em} Squats
            & 6 x 80kg
            & 6 x 80kg
            & 5 x 85kg
            & 5 x 85kg
            & 4 x 90kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 6 x 85kg
            & 5 x 90kg
            & 5 x 90kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 6 x 26kg
            & 6 x 26kg
            & 5 x 26kg
            & 5 x 26kg
            & 4 x 28kg
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 5 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 6 x 70kg
            & 5 x 75kg
            & 5 x 75kg
            & 4 x 75kg
            & 4 x 75kg
            \\


            \hspace{0.75em} Squats
            & 6 x 90kg
            & 5 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            & 4 x 95kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 6 x 90kg
            & 5 x 95kg
            & 5 x 95kg
            & 4 x 95kg
            & 4 x 95kg
            \\


            \hspace{0.75em} Squats
            & 6 x 85kg
            & 5 x 85kg
            & 5 x 85kg
            & 4 x 90kg
            & 4 x 90kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 6 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 6 x 26kg
            & 5 x 28kg
            & 5 x 28kg
            & 4 x 28kg
            & 4 x 28kg
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 6 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 6 x 70kg
            & 5 x 75kg
            & 4 x 75kg
            & 4 x 75kg
            & 4 x 75kg
            \\


            \hspace{0.75em} Squats
            & 6 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            & 4 x 95kg
            & 4 x 95kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 6 x 90kg
            & 5 x 95kg
            & 4 x 100kg
            & 4 x 100kg
            & 4 x 100kg
            \\


            \hspace{0.75em} Squats
            & 6 x 85kg
            & 5 x 90kg
            & 4 x 90kg
            & 4 x 90kg
            & 4 x 90kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 5 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 6 x 26kg
            & 5 x 28kg
            & 4 x 28kg
            & 4 x 28kg
            & 4 x 28kg
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 7 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 5 x 75kg
            & 5 x 75kg
            & 4 x 75kg
            & 4 x 75kg
            & 3 x 80kg
            \\


            \hspace{0.75em} Squats
            & 5 x 95kg
            & 5 x 95kg
            & 4 x 95kg
            & 4 x 95kg
            & 3 x 100kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 5 x 95kg
            & 5 x 95kg
            & 4 x 100kg
            & 4 x 100kg
            & 3 x 105kg
            \\


            \hspace{0.75em} Squats
            & 5 x 90kg
            & 5 x 90kg
            & 4 x 95kg
            & 4 x 95kg
            & 3 x 100kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 5 x 95kg
            & 4 x 95kg
            & 4 x 95kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 5 x 28kg
            & 5 x 28kg
            & 4 x 30kg
            & 4 x 30kg
            & 3 x 30kg
            \\


  \end{tabular}


 \subsection*{\hspace{0.25em} Week 8 }
  \subsection*{\hspace{0.5em} Day 1 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Bench
            & 5 x 75kg
            & 4 x 80kg
            & 4 x 80kg
            & 4 x 80kg
            & 3 x 80kg
            \\


            \hspace{0.75em} Squats
            & 5 x 95kg
            & 4 x 100kg
            & 4 x 100kg
            & 4 x 100kg
            & 3 x 100kg
            \\


   \hspace{0.75em} Curls &  \multicolumn{ 5 }{l}{ 3 x 12 } \\
  \end{tabular}

  \subsection*{\hspace{0.5em} Day 2 }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 5 x 100kg
            & 4 x 100kg
            & 4 x 100kg
            & 4 x 100kg
            & 3 x 105kg
            \\


            \hspace{0.75em} Squats
            & 5 x 95kg
            & 4 x 95kg
            & 4 x 95kg
            & 4 x 95kg
            & 3 x 100kg
            \\


  \end{tabular}

  \subsection*{\hspace{0.5em} Saturday }


  \begin{tabular}{l|lllll}
  \hspace{0.75em} \textbf{Exercise} & \multicolumn{ 5 }{l}{ \textbf{Sets / reps} } \\ \hline

            \hspace{0.75em} Deadlifts
            & 5 x 95kg
            & 4 x 100kg
            & 3 x 100kg
            &
            &
            \\


            \hspace{0.75em} Curls
            & 5 x 28kg
            & 4 x 30kg
            & 4 x 30kg
            & 4 x 30kg
            & 3 x 30kg
            \\


  \end{tabular}



\end{document}